//
//  QSPageContentView.h
//  QSSegmentViewControllerDemo
//
//  Created by apple on 2017/9/15.
//  Copyright © 2017年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>

@class QSPageContentView;

@protocol QSPageContentViewDelegate <NSObject>

@optional

/**
 *  开始滑动
 *
 *  @param contentView QSPageContentView
 */
- (void)QSPageContentViewWillBeginDragging:(QSPageContentView *)contentView;

/**
 *  滑动调用
 *
 *  @param contentView QSPageContentView
 *  @param startIndex 开始滑动页面索引
 *  @param endIndex 结束滑动页面索引
 *  @param progress 滑动进度
 */
- (void)QSPageContentViewDidScroll:(QSPageContentView *)contentView startIndex:(NSInteger)startIndex endIndex:(NSInteger)endIndex progress:(CGFloat)progress;

/**
 *  结束滑动
 *
 *  @param contentView QSPageContentView
 *  @param startIndex 开始滑动索引
 *  @param endIndex 结束滑动索引
 */
- (void)QSPageContentViewDidEndDecelerating:(QSPageContentView *)contentView startIndex:(NSInteger)startIndex endIndex:(NSInteger)endIndex;

@end

@interface QSPageContentView : UIView
/**
 *  初始化方法
 *
 *  @param frame frame
 *  @param childVCs 子VC数组
 *  @param parentVC 父视图VC
 *  @param delegate delegate
 */
- (instancetype)initWithFrame:(CGRect)frame childVCs:(NSArray *)childVCs parentVC:(UIViewController *)parentVC delegate:(id<QSPageContentViewDelegate>)delegate;

@property (nonatomic, weak) id<QSPageContentViewDelegate>delegate;

/**
 *  设置contentView当前展示的页面索引，默认为0
 */
@property (nonatomic, assign) NSInteger contentViewCurrentIndex;

/**
 *  设置contentView能否左右滑动，默认YES
 */
@property (nonatomic, assign) BOOL contentViewCanScroll;
@end
